package com.cn.intelligence.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cn.intelligence.pojo.EUDataGridResult;
import com.cn.intelligence.pojo.TaotaoResult;
import com.cn.intelligence.pojo.Vip;
import com.cn.intelligence.service.VipService;
/**
 * 系统管理员信息
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/vip/")
public class VipUserController {

	@Autowired
	VipService vipService;
	/**
     * 查询用户列表
     * @param page
     * @param rows
     * @return
     */
    @RequestMapping("list")
    @ResponseBody
    public EUDataGridResult getSystemUserList(Integer page,Integer rows,Vip vip){
    	EUDataGridResult euDataGridResult = new EUDataGridResult();
    	euDataGridResult =vipService.getVipUserList(page,rows,vip);	
        return euDataGridResult;
    }
    /**
     * 添加和修改用户信息
     * @param tbMuser
     * @return
     */
    @RequestMapping(value = "andVip",method = RequestMethod.POST)
    @ResponseBody
    public TaotaoResult andOrUpdateUser(Vip vip){
    	
    	TaotaoResult taotaoResult= vipService.insertVip(vip);
    	return taotaoResult;
    }
    /**
     * 删除用户
     * @param tbMuser
     * @return
     */
    @RequestMapping(value = "delete",method = RequestMethod.POST)
    @ResponseBody
    public TaotaoResult deleteUser(Long ids[]){
  
    	TaotaoResult taotaoResult= vipService.deleteUser(ids);
    	return taotaoResult;
    }
    
    /**
     * 删除用户
     * @param tbMuser
     * @return
     */
    @RequestMapping(value = "cususerbyId",method = RequestMethod.POST)
    @ResponseBody
    public TaotaoResult cususerbyId(Long id){
  
    	TaotaoResult taotaoResult= vipService.cususerbyId(id);
    	return taotaoResult;
    }
    
}
